<template>
  <div>
    <div class="head">
      <van-icon class="arrow-left" name="arrow-left" @click="goBack" />
    </div>
    <van-card
      :price="item.originprice"
      :title="item.proname"
      :thumb="item.img1"
     v-for="item in list" :key="item.proid"
     
    />
  </div>
</template>

<script>
export default {
  name: "Brand",
  data() {
    return {
      category: "",
      brand: "",
      list:[]
    };
  },
  methods: {
    goBack(){
       this.$router.back();
    },
   
  },
  
// 获取某分类下某品牌的产品列表
  created(){
   this. category=this.$route .query.category
   this. brand=this.$route .query.brand
   
     this.$server({
        url:"/api/pro/categorybrandprolist",
        params:{
            category:this.category,
            brand:this.brand
        }
     }).then((res)=>{
        if(res.data.code==200){
            console.log(res.data);
            this.list=res.data.data 
        }
     })
  }
};
</script>

<style scoped>
.head {
  height: 45px;
  background-color: skyblue;
  text-align: center;
  line-height: 45px;
}
.arrow-left {
  float: left;
  margin: 1rem;
  color: blue;
}
</style>
